﻿/*---------------------------------------------------------------------------------
-----------------***DaLianQianYi***-----------------------
-----------------作者：大连仟亿科技------------------------------------------------------
-----------------联系作者：www.qianyikeji.com----------------------------------
-----------------时间：2018/8/6 18:06:36------------------------------------------
----------------------------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Donal.Xms.BLL
{
/// <summary>
///数据业务层
/// </summary>
public partial class actions
{
    private readonly Model.sysconfig sysConfig = new BLL.sysconfig().loadConfig();//获得系统配置信息
    private readonly DAL.actions dal;

    public actions()
    {
        dal = new DAL.actions(sysConfig.sysdatabaseprefix);
    }

    #region 基本方法================================
    /// <summary>
    /// 是否存在该记录
    /// </summary>
    public bool Exists(int id)
    {
        return dal.Exists(id);
    }

    /// <summary>
    /// 增加一条数据
    /// </summary>
    public int Add(Model.actions model)
    {
        return dal.Add(model);
    }

    /// <summary>
    /// 更新一条数据
    /// </summary>
    public bool Update(Model.actions model)
    {
        return dal.Update(model);
    }

    /// <summary>
    /// 删除一条数据
    /// </summary>
    public bool Delete(int id)
    {
        return dal.Delete(id);
    }

    /// <summary>
    /// 得到一个对象实体
    /// </summary>
    public Model.actions GetModel(int id)
    {
        return dal.GetModel(id);
    }

    /// <summary>
    /// 获得前几行数据
    /// </summary>
    public DataSet GetList(int Top, string strWhere, string filedOrder)
    {
        return dal.GetList(Top, strWhere, filedOrder);
    }

    /// <summary>
    /// 获得查询分页数据
    /// </summary>
    public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
    {
        return dal.GetList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
    }
    #endregion

    #region 扩展方法================================
    /// <summary>
    /// 返回指定列
    /// </summary>
    public string GetValue(int id,string fileName)
    {
        return dal.GetValue(id,fileName);
    }

    /// <summary>
    /// 修改一列数据
    /// </summary>
    public bool UpdateField(int id, string strValue)
    {
         return dal.UpdateField(id, strValue);
    }
    #endregion
}
}


